home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-16 | 2.2 KB | 81 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CGraphGAApp.h ©1995-97 Timo Eloranta All rights reserved.
- // ===========================================================================
- // The application class - subclassed from LDocApplication.
-
- #pragma once
-
- #include <LDocApplication.h>
- #include <LGADialogBox.h> // SLGADialogResponse
-
- #include "MyStructs.h" // SSelection, STermination,
- // SEvaluation, SGeneral
- class CGraphWindow;
- class CGraphGADoc;
-
- class CGraphGAApp : public LDocApplication {
- private:
-
- CGraphWindow *mWindow;
- CGraphGADoc *mDoc;
-
- Boolean mDocShouldGetShot;
-
- void InitForNoGraph();
- void RemoveDoc();
- void SetDefaults();
- void RegisterClasses();
- Boolean AskNewGraphSize();
-
- void SetProbsFromDialog( SLGADialogResponse *inResponse );
- void SetTerFromDialog( SLGADialogResponse *inResponse );
- void SetEvalFromDialog( SLGADialogResponse *inResponse );
-
- virtual void EventSuspend (const EventRecord &inMacEvent);
- virtual void EventResume (const EventRecord &inMacEvent);
-
- protected:
- virtual void Initialize();
-
- public:
- CGraphGAApp();
- virtual ~CGraphGAApp();
-
- // this overriding function performs application functions
-
- virtual Boolean ObeyCommand( CommandT inCommand, void* ioParam = nil);
-
- // this overriding function returns the status of menu items
-
- virtual void FindCommandStatus( CommandT inCommand,
- Boolean &outEnabled, Boolean &outUsesMark,
- Char16 &outMark, Str255 outName);
-
- virtual void OpenDocument( FSSpec *inMacFSSpec );
- virtual LModelObject* MakeNewDocument();
- virtual void ChooseDocument();
-
- virtual void ShowAboutBox();
-
- Int32 mNewGraphNodes,
- mNewGraphEdges,
- mCrossoverProb,
- mMutationProb;
- SSelection mSelection;
- STermination mTermination;
- SEvaluation mEvaluation;
- SGeneral mGeneral;
-
- Int16 GetGridSize() { return mGeneral.sizeGrid; };
-
- void SetSelFromDialog( SLGADialogResponse *inResponse );
- void SetGeneralFromDialog( SLGADialogResponse *inResponse,
- Int16 inNodes );
-
- void SetDocToBeShot( Boolean inShoot )
- { mDocShouldGetShot = inShoot; };
-
- CGraphWindow * GetGraphWindow()
- { return mWindow; };
- };
-